package index

var _ Index = IndexAscendFlatInt8{}

// IndexAscendFlatInt8 idx type for ASCEND_FLAT_INT8
type IndexAscendFlatInt8 struct {
	baseIndex
}

// Name returns index type name, implementing Index interface
func (i IndexAscendFlatInt8) Name() string {
	return "AscendFlatInt8"
}

// IndexType returns IndexType, implementing Index interface
func (i IndexAscendFlatInt8) IndexType() IndexType {
	return IndexType("ASCEND_FLAT_INT8")
}

// Params returns index construction params, implementing Index interface
func (i IndexAscendFlatInt8) Params() map[string]string {
	return map[string]string{
		MetricTypeKey: string(i.metricType),
		IndexTypeKey:  string(AscendFlatInt8),
	}
}

// SupportBinary returns whether index supports binary vectors
// Note: AscendFlatInt8 is for quantized float vectors, not binary
func (i IndexAscendFlatInt8) SupportBinary() bool {
	return false
}

// NewIndexAscendFlatInt8 creates a new ASCEND_FLAT_INT8 index
func NewIndexAscendFlatInt8(metricType MetricType) Index {
	return IndexAscendFlatInt8{
		baseIndex: baseIndex{
			name:       "AscendFlatInt8",
			metricType: metricType,
			indexType:  AscendFlatInt8,
		},
	}
}

var _ Index = IndexAscendFlat{}

// IndexAscendFlat idx type for ASCEND_FLAT
type IndexAscendFlat struct {
	baseIndex
}

// Name returns index type name
func (i IndexAscendFlat) Name() string {
	return "AscendFlat"
}

// IndexType returns IndexType
func (i IndexAscendFlat) IndexType() IndexType {
	return IndexType("ASCEND_FLAT")
}

// Params returns index construction params
func (i IndexAscendFlat) Params() map[string]string {
	return map[string]string{
		MetricTypeKey: string(i.metricType),
		IndexTypeKey:  string(AscendFlat),
	}
}

// SupportBinary returns whether index supports binary vectors
func (i IndexAscendFlat) SupportBinary() bool {
	return false
}

// NewIndexAscendFlat creates a new ASCEND_FLAT index
func NewIndexAscendFlat(metricType MetricType) Index {
	return IndexAscendFlat{
		baseIndex: baseIndex{
			name:       "AscendFlat",
			metricType: metricType,
			indexType:  AscendFlat,
		},
	}
}
